package com.itheima.day_08;

import java.util.Scanner;

/*
比较两个字符串
equals:比较字符串的内容,区分大小写
equalsIgnoreCase:比较字符串的内容,忽略大小写
 */
public class Test07 {
    public static void main(String[] args) {
        //键入两个字符串,用Scanner实现
        Scanner sc = new Scanner(System.in);
        //用户提示
        System.out.println("请输入第一个字符串");
        String stu1 = sc.next();
        System.out.println("请输入第二个字符串");
        String stu2 = sc.next();


    /* *//* System.out.println(stu1);
        System.out.println(stu2);
        System.out.println(stu1==stu2);*//*
        *//*boolean bo = stu1.equals(stu2);
        String stu3 ="abc";
        String stu4 ="abc";
        System.out.println(stu3==stu4);*//*

        String s1 = "abc";
        String s2 = "ab";
        String s3 ="ab"+"c";

        System.out.println(s1==s3);*/

        //使用equals比较两个字符串是否相同,返回值是boolean类型
        System.out.println(stu1.equals(stu2));
        //使用equalsIgnoreCase
        System.out.println(stu1.equalsIgnoreCase(stu2));
    }
}
